package com.lineage.server.serverpackets;

import com.lineage.config.ConfigAlt;
import com.lineage.echo.ClientExecutor;

public class S_CharAmount extends ServerBasePacket {
  private byte[] _byte;
  
  public S_CharAmount(int value, ClientExecutor client) {
    this._byte = null;
    buildPacket(value, client);
  }
  
  private void buildPacket(int value, ClientExecutor client) {
    int characterSlot = client.getAccount().get_character_slot();
    int maxAmount = ConfigAlt.DEFAULT_CHARACTER_SLOT + characterSlot;
    writeC(178);
    writeC(value);
    writeC(maxAmount);
  }
  
  public byte[] getContent() {
    if (this._byte == null)
      this._byte = getBytes(); 
    return this._byte;
  }
  
  public String getType() {
    return getClass().getSimpleName();
  }
}
